import 'package:flutter/material.dart';
import 'package:flutter_app/model/video_model.dart';
import 'package:flutter_app/utils/color.dart';

class HomePage extends StatefulWidget {
  final ValueChanged<VideoModel> onJumpToDetail;

  const HomePage({Key key, this.onJumpToDetail}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("首页"),
        backgroundColor: Colors.cyan,
        titleTextStyle: const TextStyle(
          color: Colors.white,
          fontSize: 16
        ),
      ),
      body: Container(
        child: Column(
          children: [
            const Text("首页"),
            MaterialButton(onPressed:()=>widget.onJumpToDetail(VideoModel(11)),
              child: const Text("详情"),
            ),

          ],
        ),
      ),

    );
  }
}
